
{extend name="public:common_edit"/}
{block name="css"}
<style>
    .form-control {
        max-width: 350px;
    }

    .tb-name {
        width: 238px;
    }
    .error{
        color: red;
        margin-top: 10px;
        display: none;
    }
    .select{
        margin-bottom: 10px;
    }
    .doctor{
        display: none;
    }
</style>
{/block}
{block name="main"}
<section class="content">
    <div class="container-fluid">
        <div class="pull-right">
            <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default"
               data-original-title="返回"><i class="fa fa-reply"></i></a>
            <a href="javascript:void(0);" class="btn btn-default"
               data-url="javascript:;"
               onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-list"></i> {$title}</h3>
            </div>
            <div class="panel-body">
                <!--表单数据-->
                <form action="" method="post" class="form-horizontal"
                      id="category_form">

                    <!--通用信息-->
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_tongyong">
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td>封面图片:</td>
                                    <td>{:uploadHtml('img',$data.img,'single_img')}</td>
                                </tr>
                                <tr>
                                    <td>房间名:</td>
                                    <td><input placeholder="房间名" class="form-control" name="room_name" type="text" value="{$data.room_name}"></td>
                                </tr>
                                <tr>
                                    <td>粉丝数量:</td>
                                    <td>{$data.fans}</td>
                                </tr>
                                <tr>
                                    <td>礼物总额:</td>
                                    <td>{:getRoomGiftSum($data.room_id)}</td>
                                </tr>
                                {if $data['room_id']}

                                <tr>
                                    <td>房间类型:</td>
                                    <td>{$type[$data['type']]['type_name']}</td>
                                </tr>

                                {else /}

                                <tr>
                                    <td>房间类型:</td>
                                    <td>{:arr2select('type',$type,'',$data.type,'type','type_name')}</td>
                                </tr>

                                {/if}

                                <tr>
                                    <td>娱乐厅子类型:</td>
                                    <td>
                                        <select class="form-control" name="room_type">
                                            <option id="room_type1" value="1">娱乐厅</option>
                                            <option id="room_type2" value="2">交友厅</option>
                                        </select>
                                    </td>
                                </tr>


                                {if $data['type'] != 4}
                                    <tr>
                                        <td>指定房主:(输入用户id)</td>
                                        <td><input placeholder="请输入房主用户id" class="form-control" name="user_id" type="text" value="{$data.user_id}"></td>
                                    </tr>
                                {/if}

                                {if $data['room_id']}

                                <tr>
                                    <td>当前房主:</td>
                                    <td>
                                        <p style="font-size: 20px;font-weight: bold;">{$data.profile.nick_name}</p>
                                        <img style="max-width: 100px" src="{$data.profile.header_img}" alt="">

                                    </td>
                                </tr>

                                {/if}

                                {if $data['type'] == 4}

                                <tr>
                                    <td>房间分类:</td>
                                    <td>{:arr2select('cid',$cate,'',$data.cid,'cid','cate_name')}</td>
                                </tr>

                                {/if}
                                <tr>
                                    <td>房间公告:</td>
                                    <td>
                                        <textarea name="notice" class="form-control" cols="30" rows="10">{$data.notice}</textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td>排序:</td>
                                    <td><input placeholder="排序" class="form-control" name="sort" type="number" value="{$data.sort}"></td>
                                </tr>
                                <tr>
                                    <td>新用户随机进入权重:</td>
                                    <td><input placeholder="排序" class="form-control" name="weight" type="number" value="{$data.weight}"></td>
                                </tr>
                                <tr>
                                    <td>礼物抽成比例:</td>
                                    <td><input placeholder="礼物抽成比例" class="form-control" name="gift_radio" type="number" value="{$data.gift_radio}"></td>
                                </tr>
                                <tr>
                                    <td>状态:</td>
                                    <td>
                                        <select class="form-control" name="status">
                                            <option id="status1" value="1">启用</option>
                                            <option id="status0" value="0">禁用</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>房间是否加锁:</td>
                                    <td>
                                        <select class="form-control" name="is_lock">
                                            <option id="is_lock0" value="0">否</option>
                                            <option id="is_lock1" value="1">是</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td>房间密码:</td>
                                    <td><input placeholder="房间密码(不修改密码请勿填写)" class="form-control" name="password" type="text" value=""></td>
                                </tr>

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="pull-right">
                        <label class="control-label col-sm-2"></label>
                        <input type="hidden" name="id" value="{$data.room_id}">
                        <input class="btn btn-primary submit" type="submit" value="保存">
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
{/block}
{block name="js"}
<script src="/public/plugs/switch-button/js/bootstrap-switch.js"></script>
<script type="text/javascript" src="/public/plugs/jQuery-Tags-Input/src/jquery.tagsinput.js"></script>
<script>
    $(function () {

        var top   = "{$data.top}";
        if(top != ''){
            $('#top'+top).attr('selected',true)
        }

        var is_lock   = "{$data.is_lock}";
        if(is_lock != ''){
            $('#is_lock'+is_lock).attr('selected',true)
        }
        var status   = "{$data.status}";
        if(status != ''){
            $('#status'+status).attr('selected',true)
        }
    })

</script>



{/block}